<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>




 
<?php


print_r2($_REQUEST);



//插入项目信息
$_REQUEST['ai_authur']      =$_SESSION['username'];
$_REQUEST['ai_utoken']      = $_SESSION['utoken'];


//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$term_nid       = addslashes($_REQUEST['term_nid']);


//设置需要搜索的表格的前缀后缀
$table_suffix = "case";
$table = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀


$sql=insert_date($table,$_REQUEST);
$query = mysql_query($sql) or die ("error:".mysql_error());
mysql_close($con);



$_newest_case=select_lines_all_items($table,"nid desc","1 = 1","1");







//==================================
//插入项目之后，再为这个项插入采购信息

$p['table']=$table_Prefix."case_detail";
$p['items']=array("case_nid","number","price","product_nid","product_name");

foreach ($_REQUEST['number'] as $k=>$v )
{
if($v>0){
$p['values'][]=array($_newest_case[0]['nid'],$v,"",$k,$_REQUEST['product_name'][$k]);
}
}

echo $_case_detail_str=insert_datas($p);
$query = mysql_query($_case_detail_str) or die ("error:".mysql_error());
mysql_close($con);







?>

<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "detail-list.php?nav-itemed=case";
</script>


